{template 'common/header'}



<div class="clearfix">				

<ul class="nav nav-tabs">

	<li class="active"><a href="{php echo $this->createWebUrl('adv')}">幻灯片</a></li>

	<li><a href="{php echo $this->createWebUrl('adv_post')}">添加幻灯片</a></li>

</ul>

<div class="main panel panel-default">
	<div class="table-responsive">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th style="width:15%;">图片</th>
					<th style="width:10%;">排序</th>					
					<th style="width:20%;">标题</th>
					<!-- <th style="width:10%;">商品/分类ID</th> -->
					<th style="width:10%;">排序</th>
					<th style="width:10%;">状态</th>
					<th class="text-right" style="width:15%;">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $index $item}
					<tr>
						<td><img class="scrollLoading" src="{media $item['thumb']}" data-url="{media $item['thumb']}" onerror="this.src='/web/resource/images/nopic-small.jpg'" height="50" width="100"></td>
						<td>{$item['displayorder']}</td>
						<td>{$item['advname']}</td>
						<!-- <td>{$item['link']}</td> -->
						<td><input type="text" class="form-control displayorder" data-id="{$item['id']}" name="displayorder" value="{$item['displayorder']}"></td>
						<td>
							{if $item['enabled'] == 1}
							<span class="label label-success">显示</span>
							{else}
							<span class="label label-default">隐藏</span>
							{/if}
						</td>
						<td class="text-right">
							<a href="{php echo $this->createWebUrl('adv_post',array('id'=>$item['id']))}" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="" data-original-title="修改"><i class="fa fa-edit"></i></a>
							<a href="{php echo $this->createWebUrl('adv_post',array('act'=>'del','id'=>$item['id']))}" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="" data-original-title="删除"><i class="fa fa-times"></i></a>
						</td>
					</tr>
				{/loop}
				{if empty($list) }
                <tr ng-if="!wechats">
                <td colspan="9" class="text-center">暂无数据</td>
                </tr>
                {/if}
				<tr>
					<td colspan="6" style="text-align:right">{$page}</td>
				</tr>
			</tbody>
		</table>
	</div>
</div>
<script type="text/javascript">
$(".displayorder").bind('input propertychange',function(){
	$.ajax({
	    url:"{php echo $this->createWebUrl('adv_post',array('act'=>'display'))}",
	    type:'POST',
	    async:true,
	    data:{
	        displayorder:$(this).val(),id:$(this).attr('data-id')
	    },
	    timeout:5000,
	    dataType:'json',
	    success:function(data){
	        //alert(data.message);
	    }
	})
})
</script>
</div>
{template 'common/footer'}